<?php
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('adminhtml-admin-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1><?php echo $this->getActionLabel() ?></h1>

<p>您可以在搜索字符前面加 (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b> 或者 <b>=</b>) 进行搜索</p>

<?php echo CHtml::link('点击高级搜索','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'adminhtml-admin-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array(
			'class'=>'CCheckBoxColumn',
		    'id'=>'ids', 
            'selectableRows'=>2, 
			//'name'=>'adminhtml-node-grid-ids',
		),
		//'admin_id',
		array(
			'name'=>'admin_id',
			'htmlOptions'=>array('style'=>'width:30px'),
		),
		//'role.role_label',
		array(
            'name'=>'role_id',
            'value'=>'$data->role->role_label',
        ),
		'username',
		'email',
		'create_time',
		'nickname',
		array(
	        'name' => 'status',
	        'type' => 'raw',
	    	'htmlOptions'=>array('style'=>'width:30px'),
		    'value' => 'AdminhtmlHelper::getStatusLabel( $data->status )',
			'filter'=> AdminhtmlHelper::getStatusOptions(),
	    ),
	    /*
		'update_time',
		'password',
		'remark',
		*/
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
